package com.aggregate.pay.ebcpay.support.client;

import com.aggregate.pay.ebcpay.bean.QueryBalanceData;
import com.aggregate.pay.ebcpay.bean.QueryBalanceResult;
import com.aggregate.pay.ebcpay.support.AbstractClient;
import com.aggregate.pay.ebcpay.support.Merch;

/**
 * 余额查询接口
 * @author Moyq5
 * @date 2019年3月15日
 */
public class QueryBalance extends AbstractClient<QueryBalanceData, QueryBalanceResult> {

	public QueryBalance(Merch merch) {
		super(merch);
	}

	@Override
	protected Class<QueryBalanceResult> resultClass() {
		return QueryBalanceResult.class;
	}

	@Override
	protected String serverPath() {
		return super.serverPath() + "/account/balance";
	}

	@Override
	protected String signString(QueryBalanceData data) {
		return String.format("[idMerchant=%s&typeChannel=%s&version=%s&typeSign=%s&reqNo=%s&reqTime=%s]", 
				data.getIdMerchant(),
				data.getTypeChannel(),
				data.getVersion(),
				data.getTypeSign(),
				data.getReqNo(),
				data.getReqTime());
	}

}
